﻿@model Management.Core.News.News
@{
    ViewBag.Title = "新闻列表";
}
@section SideNav{@Html.Partial("SideNavPartialView")}
@using (Ajax.BeginForm("Add", new AjaxOptions()))
{
    @Html.AntiForgeryToken();
    <div class="form-horizontal">
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.Title, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Title, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Title, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Author, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Author, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Author, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ContentType, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.RadioButtonFor(model => model.ContentType, 1) 行业新闻
                @Html.RadioButtonFor(model => model.ContentType, 2) 行业动态
                @Html.ValidationMessageFor(model => model.ContentType, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Content, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextAreaFor(model => model.Content, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Content, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="保存" class="btn btn-primary" />
            </div>
        </div>
    </div>

}
@Scripts.Render("~/bundles/jqueryval")
<script src="~/Content/layer/layer.js"></script>
<script src="~/Content/ueditor/ueditor.config.js"></script>
<script src="~/Content/ueditor/ueditor.all.js"></script>
<script>
    //ueditor
    var editor = new baidu.editor.ui.Editor({
        UEDITOR_HOME_URL: '/Content/ueditor/', //配置编辑器路径
        iframeCssUrl: '/Content/ueditor/themes/iframe.css',//样式路径
        autoHeightEnabled: true, //高度自动增长
        initialFrameHeight: 400, //初始高度为400px
    });
    editor.render('Content');
</script>
